package app.util;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletContextHandler;

public class OneServletContext {

	public static void main(String[] args) throws Exception {
		Server server = new Server(8083);
		
		ServletContextHandler context = new ServletContextHandler();
		/*context.setResourceBase(System.getProperty("java.io.tmpdir"));*/
		context.setResourceBase("d:/");
		//可以添加多个servlet
		context.addServlet(DefaultServlet.class, "/");
		
		server.setHandler(context);
		
		server.start();
		server.join();
	}
}
